<template>
  <svg :style="{ width, height }" aria-hidden="true">
    <use :xlink:href="prefix + name" :fill="color"></use>
  </svg>
</template>

<script setup lang="ts">
defineProps({
  //前缀
  prefix: {
    type: String,
    // default: "#icon-",
    default: "#svg-icon-",
  },
  //图标名称
  name: String,
  //颜色
  color: {
    type: String,
    default: "",
  },
  //宽高，不传入默认为30px
  width: {
    type: String,
    default: "21px",
  },
  height: {
    type: String,
    default: "21px",
  },
});
</script>

<style scoped></style>
